FROM openjdk:17-jdk-alpine as builder
#maven:3.5-jdk-8-alpine
#openjdk:17-jdk-alpine
#maven:3.8.6-openjdk-17
WORKDIR /app
# 暴露应用端口
EXPOSE 8123
# 设置时区（避免时间问题）
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

COPY pom.xml .
COPY src ./src
COPY target/OmegaCore-0.0.1-SNAPSHOT.jar /app/target/
COPY target/OmegaCore-0.0.1-SNAPSHOT.jar.original /app/target/
# RUN mvn package -DskipTests

ENTRYPOINT ["java", "-jar","/app/target/OmegaCore-0.0.1-SNAPSHOT.jar","--spring.profiles.active=prod"]